-
Notifications
You must be signed in to change notification settings - Fork 102
add code action quick-fix to add @override
#1680
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
This comment has been minimized.
This comment has been minimized.
|
to get auto imports working, you can probably use the same method i used for completions basedpyright/packages/pyright-internal/src/languageService/completionProvider.ts Lines 559 to 575 in 0b0e727
|
The AutoImporter does import, however I firstly tried and found that it still does import even when the symbol is already imported - this causes duplicate imports. Using CompletionProvider is also currently not possible - it can only process the symbol already been in the document. I'm not sure either duplicate import or letting users do double-fix would be better, or there are better solutions? |
|
i was able to get it working. i just pushed my changes. needs to be cleaned up a bit though (mainly the duplicated code) |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
@override@override
This comment has been minimized.
This comment has been minimized.
DetachHead
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for the contribution
packages/pyright-internal/src/languageService/codeActionProvider.ts
Outdated
Show resolved
Hide resolved
packages/pyright-internal/src/languageService/codeActionProvider.ts
Outdated
Show resolved
Hide resolved
This comment has been minimized.
This comment has been minimized.
packages/pyright-internal/src/languageService/codeActionProvider.ts
Outdated
Show resolved
Hide resolved
|
looks like some execution order randomly incorrect (check before parse) on this macos test. maybe related to a new issue or some hard-to-reproduce issues. basedpyright/packages/pyright-internal/src/analyzer/program.ts Lines 2023 to 2082 in 6c2a199
|
|
According to mypy_primer, this change doesn't affect type check results on a corpus of open source code. ✅ |
|
yeah i've seen that failure before, no idea what causes it but re-running the job usually fixes it. i'll open a separate issue to investigate |
fixes #1627